import {
  validatePhone,
  validateEmail,
  validateIdCard,
  validateMoney,
  validateBankId
} from "@/utils/validates.js"

const addSchoolForm = {
  formRules: {
    school_name: {
      rules: [
        {
          required: true,
          errorMessage: "请输入教练姓名"
        }
      ]
    },
    contact_phone: {
      rules: [
        {
          required: false,
          errorMessage: "请输入教练姓名"
        },
        {
          validateFunction: validatePhone
        }
      ]
    },
    contact_name: {
      rules: [
        {
          required: true,
          errorMessage: "请输入负责人姓名"
        }
      ]
    },
    module_hour: {
      rules: [
        {
          required: true,
          errorMessage: "请输入开户金额"
        },
        {
          validateFunction: validateMoney
        }
      ]
    },
    company_name: {
      rules: [
        {
          required: true,
          errorMessage: "请输入公司名称"
        }
      ]
    },
    contact_name: {
      rules: [
        {
          required: true,
          errorMessage: "请输入负责人名称"
        }
      ]
    },
    id_card_number: {
      rules: [
        {
          required: true,
          errorMessage: "请输入负责人身份证号"
        },
        {
          validateFunction: validateIdCard
        }
      ]
    },
    bank_account: {
      rules: [
        {
          required: true,
          errorMessage: "请输入银行账号"
        },
        {
          validateFunction: validateBankId
        }
      ]
    },
    join_time: {
      rules: [
        {
          required: true,
          errorMessage: "请选择加盟时间"
        }
      ]
    },
    area: {
      rules: [
        {
          required: true,
          errorMessage: "请输入所在区域"
        }
      ]
    },
    address: {
      rules: [
        {
          required: true,
          errorMessage: "请输入详细地址"
        }
      ]
    },
    from: {
      rules: [
        {
          required: true,
          errorMessage: "请选择渠道"
        }
      ]
    }
  },
  formList: [
    {
      formType: "input",
      name: "school_name",
      label: "机构名称",
      placeholder: "请输入机构名称",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "module_hour",
      label: "开户金额",
      type: "number",
      placeholder: "请输入开户金额",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "company_name",
      label: "公司名称",
      placeholder: "请输入公司名称",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "contact_name",
      label: "负责人",
      placeholder: "请输入负责人名称",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "contact_phone",
      label: "手机号",
      placeholder: "请输入负责人手机号",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "id_card_number",
      label: "身份证号",
      placeholder: "请输入负责人身份证号",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "mailbox",
      label: "邮箱",
      placeholder: "请输入负责人邮箱",
      value: "",
      required: false
    },
    {
      formType: "input",
      name: "auth_password",
      label: "新授权码",
      placeholder: "请输入新授权码",
      value: "",
      required: false
    },
    {
      formType: "input",
      name: "bank_account",
      label: "银行账号",
      placeholder: "请输入银行账号",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "salesman",
      label: "业务员",
      placeholder: "请输入业务员",
      value: "",
      required: false
    },
    {
      formType: "select",
      name: "level",
      label: "上级代理",
      placeholder: "请选择上级代理",
      value: "",
      options: [
        {
          text: "总部",
          value: 1
        },
        {
          text: "省",
          value: 2
        },
        {
          text: "省会",
          value: 3
        },
        {
          text: "地级市",
          value: 4
        },
        {
          text: "区/县",
          value: 5
        },
        {
          text: "单店一",
          value: 6
        },
        {
          text: "单店二",
          value: 7
        },
        {
          text: "单店三",
          value: 8
        }
      ],
      required: false
    },
    {
      formType: "date",
      name: "join_time",
      label: "加盟时间",
      placeholder: "请选择加盟时间",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "area",
      label: "所在区域",
      placeholder: "请输入所在区域",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "address",
      label: "详细地址",
      placeholder: "请输入详细地址",
      value: "",
      required: true
    },
    {
      formType: "select",
      name: "from",
      label: "渠道",
      placeholder: "请选择渠道",
      value: "",
      options: [
        {
          text: "个人",
          value: 1
        },
        {
          text: "客户介绍",
          value: 2
        },
        {
          text: "招商会",
          value: 3
        }
      ],
      required: true
    },
    {
      formType: "cascader",
      name: "protected_area",
      label: "受保护区域",
      placeholder: "请选择受保护区域",
      value: [],
      options: [],
      required: false
    }
  ],
  formField: {
    school_name: "",
    module_hour: "",
    company_name: "",
    contact_name: "",
    id_card_number: "",
    contact_phone: "",
    mailbox: "",
    auth_password: "",
    bank_account: "",
    salesman: "",
    level: "",
    join_time: "",
    area: "",
    address: "",
    from: "",
    protected_area: []
  }
}

const schoolAuthForm = {
  formRules: {
    aggreement_image: {
      rules: [
        {
          required: true,
          errorMessage: "请上传合同签署页"
        }
      ]
    }
  },
  formList: [
    {
      formType: "upload",
      name: "id_card_font_image",
      label: "身份证正面照",
      value: "",
      required: false
    },
    {
      formType: "upload",
      name: "id_card_behind_image",
      label: "身份证背面照",
      value: "",
      required: false
    },
    {
      formType: "upload",
      name: "license_image",
      label: "营业执照",
      value: "",
      required: false
    },
    {
      formType: "upload",
      name: "aggreement_image",
      label: "合同签署页",
      value: "",
      required: true
    },
    {
      formType: "upload",
      name: "company_image",
      label: "公司门头/前台",
      value: "",
      required: false
    }
  ],
  formField: {
    id_card_font_image: "",
    id_card_behind_image: "",
    license_image: "",
    aggreement_image: "",
    company_image: ""
  }
}

const rechargeForm = {
  formRules: {
    module_minute: {
      rules: [
        {
          required: true,
          errorMessage: "请输入充值数额"
        },
        {
          validateFunction: validateMoney
        }
      ]
    },
    collection_name: {
      rules: [
        {
          required: true,
          errorMessage: "请输入收款户名"
        }
      ]
    },
    collection_account: {
      rules: [
        {
          required: true,
          errorMessage: "请输入收款账号"
        }
      ]
    },
    collection_money: {
      rules: [
        {
          required: true,
          errorMessage: "请输入收款金额"
        },
        {
          validateFunction: validateMoney
        }
      ]
    },
    collection_time: {
      rules: [
        {
          required: true,
          errorMessage: "请选择收款日期"
        }
      ]
    },
    collection_form: {
      rules: [
        {
          required: true,
          errorMessage: "请选择收款渠道"
        }
      ]
    }
  },
  formList: [
    {
      formType: "input",
      type: "number",
      name: "module_minute",
      label: "充值数额",
      placeholder: "请输入充值数额",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "collection_name",
      label: "收款户名",
      placeholder: "请输入收款户名",
      value: "",
      required: true
    },
    {
      formType: "input",
      name: "collection_account",
      label: "收款账号",
      placeholder: "请输入收款账号",
      value: "",
      required: true
    },
    {
      formType: "input",
      type: "number",
      name: "collection_money",
      label: "收款金额",
      placeholder: "请输入收款金额",
      value: "",
      required: true
    },
    {
      formType: "date",
      name: "collection_time",
      label: "收款日期",
      placeholder: "请选择收款日期",
      value: "",
      required: true
    },
    {
      formType: "select",
      name: "collection_form",
      label: "收款渠道",
      placeholder: "请选择收款渠道",
      value: "",
      options: [
        {
          text: "微信",
          value: 1
        },
        {
          text: "支付宝",
          value: 2
        },
        {
          text: "银行账户",
          value: 3
        },
        {
          text: "其它",
          value: 4
        }
      ],
      required: true
    },
    {
      formType: "upload",
      name: "collection_img",
      label: "收款图片",
      value: "",
      required: false
    }
  ],
  formField: {
    module_minute: "",
    collection_name: "",
    collection_account: "",
    collection_money: "",
    collection_time: "",
    contact_phone: "",
    collection_form: "",
    collection_img: ""
  }
}
export { addSchoolForm, schoolAuthForm, rechargeForm }
